/*
 * Copyright 2010 Christoph Widulle (christoph.widulle@googlemail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */



package org.amarena2d.examples.scenes;

import com.android1.amarena2d.input.ScrollController;
import com.android1.amarena2d.nodes.Scene;
import com.android1.amarena2d.nodes.SimpleLabel;
import com.android1.amarena2d.nodes.layer.ParallaxNode;
import com.android1.amarena2d.nodes.sprites.Sprite;
import com.badlogic.gdx.graphics.Color;
import org.amarena2d.examples.Example;


//todo comments
@Example(name = "Parallax Node", category = "Nodes")
public class ParallaxNodeExampleScene extends Scene {

    ParallaxNode parallaxNode;

    public ParallaxNodeExampleScene() {

        engine.getRenderer().setClearColor(Color.WHITE);

        parallaxNode = new ParallaxNode(5);

        touch().makeTouchable(new ScrollController(parallaxNode));

        final Sprite mapSprite = new Sprite("background_sunset.png", -20, -20);
        parallaxNode.add(mapSprite, 0.2F, 0.2F);

        final Sprite cloud1 = new Sprite("cloud1.png", 150, 250);
        final Sprite cloud2 = new Sprite("cloud2.png", 260, 230);
        final Sprite bat = new Sprite("enemy_bat02.png", 120, 70);
        final Sprite karaguin = new Sprite("enemy_karaguin01.png", 210, 150);

        parallaxNode.add(bat, 1.7F, 1.7F);
        parallaxNode.add(karaguin, 1.3F, 1.3F);

        parallaxNode.add(cloud1, 0.8F, 0.8F);
        parallaxNode.add(cloud2, 0.6F, 0.6F);

        add(parallaxNode);


        add(new SimpleLabel("(Drag the Screen.)", 100, 20, Color.BLACK));

    }

}